Skip to main content
DELETE
/
api
/
detalles
/
{detalleId}
Remove Item from Order
curl --request DELETE \
  --url https://api.example.com/api/detalles/{detalleId}
{
  "204": {},
  "401": {},
  "403": {},
  "404": {}
}

Authentication

This endpoint requires JWT authentication. Include the Bearer token in the Authorization header.

Path Parameters

detalleId
long
required
The unique identifier of the order detail (line item) to remove

Response

This endpoint returns no content on successful deletion.

Example Request

cURL
curl -X DELETE "http://localhost:8080/api/detalles/45" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
JavaScript
const response = await fetch('http://localhost:8080/api/detalles/45', {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${token}`
  }
});

if (response.ok) {
  console.log('Item removed from order');
}
Python
import requests

headers = {
    'Authorization': f'Bearer {token}'
}
response = requests.delete(
    'http://localhost:8080/api/detalles/45',
    headers=headers
)

if response.status_code == 204:
    print('Item removed successfully')

Status Codes

204
No Content
Order detail deleted successfully
401
Unauthorized
Missing or invalid JWT token
403
Forbidden
User does not have permission to modify this order
404
Not Found
Order detail with specified ID not found

Use Cases

  • Cart management: Remove unwanted items from shopping cart
  • Order corrections: Delete incorrect line items
  • Inventory constraints: Remove items that are no longer available
  • Customer cancellations: Allow customers to remove items before order finalization
Deleting an order detail permanently removes it from the order. This action cannot be undone.
Ensure the order status allows modifications. Some order states may not permit removing items.
Alternatively, you can set the quantity to 0 using the Update Order Item Quantity endpoint to achieve the same result.

Update Quantity

Modify item quantity (can also delete by setting to 0)

Get Order Details

View all items in an order